package com.jiang.lianxi;

public class ZiZhengYunSuanFu {
    public static void main(String[] args) {
        //当自增运算符单独在一行的时候，不管在变量前还是变量后都是一样的
        int a = 10;
        a++;
        System.out.println(a);//11
        ++a;
        System.out.println(a);//12
        a--;
        System.out.println(a);//11
        --a;
        System.out.println(a);//10
        //自增运算符参加运算
        int b = 20;
        int c = b++;//先用后加
        System.out.println(c);//20
        c = ++b;//先加后用
        System.out.println(c);//22

    }
}
